#************************************************************************
#*   IRC - Internet Relay Chat, src/modules/Makefile
#*   Copyright (C) Carsten V. Munk 2001
#*
#*   This program is free software; you can redistribute it and/or modify
#*   it under the terms of the GNU General Public License as published by
#*   the Free Software Foundation; either version 1, or (at your option)
#*   any later version.
#*
#*   This program is distributed in the hope that it will be useful,
#*   but WITHOUT ANY WARRANTY; without even the implied warranty of
#*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#*   GNU General Public License for more details.
#*
#*   You should have received a copy of the GNU General Public License
#*   along with this program; if not, write to the Free Software
#*   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#*   
#*   $Id: Makefile.in,v 1.1.6.4 2004/07/03 19:04:32 syzop Exp $
#*/

INCLUDES = ../include/struct.h ../include/config.h \
	../include/sys.h ../include/common.h ../include/version.h \
	../include/h.h ../include/numeric.h ../include/msg.h \
	../include/dynconf.h ../include/modules.h ../include/setup.h

R_MODULES=cloak.so nocloak.so m_chgswhois.so m_privdeaf.so m_getinfo.so \
	 m_nocodes.so noctcp.so m_nopost.so m_starttls.so m_userip.so

COMMANDS=m_sethost.c m_chghost.c m_chgident.c m_setname.c m_setident.c \
         m_sdesc.c m_svsmode.c m_swhois.c m_svsmotd.c m_svsnline.c \
	 m_who.c m_mkpasswd.c m_away.c m_svsnoop.c m_svso.c m_svsnick.c \
	 m_adminchat.c m_akill.c m_chgname.c m_guest.c m_htm.c m_kill.c \
 	 m_lag.c m_message.c m_nachat.c m_oper.c m_pingpong.c \
	 m_quit.c m_rakill.c m_rping.c m_sendumode.c m_sqline.c \
	 m_tsctl.c m_unkline.c m_unsqline.c m_unzline.c m_whois.c \
	 m_tkl.c m_vhost.c m_cycle.c m_svsjoin.c m_svspart.c \
	 m_svslusers.c m_svswatch.c m_svssilence.c m_sendsno.c \
	 m_svssno.c m_sajoin.c m_sapart.c m_samode.c m_kick.c m_topic.c \
	 m_invite.c m_list.c m_time.c m_svskill.c m_sjoin.c \
	 m_pass.c m_userhost.c m_ison.c m_silence.c m_knock.c m_umode2.c \
	 m_squit.c m_protoctl.c m_addline.c m_addmotd.c m_addomotd.c \
	 m_wallops.c m_admin.c m_globops.c m_locops.c m_chatops.c \
	 m_trace.c m_netinfo.c m_links.c m_help.c m_rules.c \
	 m_close.c m_map.c m_eos.c m_server.c m_stats.c \
	 m_svsfline.c m_dccdeny.c m_undccdeny.c m_whowas.c \
	 m_connect.c m_dccallow.c m_accept.c m_svsaccept.c \
	 m_idreq.c m_idreply.c m_nopost.c m_starttls.c \
	 m_userip.c


MODULES=commands.so $(R_MODULES)
MODULEFLAGS=@MODULEFLAGS@

all: build

build: $(MODULES)

custommodule: $(MODULEFILE).c
	$(CC) $(CFLAGS) $(MODULEFLAGS) $(EXLIBS) -DDYNAMIC_LINKING \
		-o $(MODULEFILE).so $(MODULEFILE).c		

commands.so: l_commands.c $(COMMANDS) $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -o commands.so l_commands.c \
	$(COMMANDS)

cloak.so: cloak.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o cloak.so cloak.c

nocloak.so: nocloak.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o nocloak.so nocloak.c

m_chgswhois.so: m_chgswhois.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_chgswhois.so m_chgswhois.c

m_privdeaf.so: m_privdeaf.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_privdeaf.so m_privdeaf.c

m_getinfo.so: m_getinfo.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_getinfo.so m_getinfo.c

m_nocodes.so: m_nocodes.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_nocodes.so m_nocodes.c

noctcp.so: noctcp.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o noctcp.so noctcp.c

m_nopost.so: m_nopost.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_nopost.so m_nopost.c

m_starttls.so: m_starttls.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_starttls.so m_starttls.c

m_userip.so: m_userip.c $(INCLUDES)
	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
		-o m_userip.so m_userip.c

clean:
	$(RM) -f *.o *.so *~ core
